import Vue from 'vue'
import FastClick from 'fastclick'
import { sync } from 'vuex-router-sync'
import { Toast, Indicator } from 'mint-ui'
import 'mint-ui/lib/style.css'
import 'element-ui/lib/theme-chalk/index.css'

import App from '~/App'
import router from '~/router'
import store from '~/store'

sync(store, router)
FastClick.attach(document.body)

Vue.config.productionTip = false

Vue.prototype.$toast = (message = '', position = 'middle', duration = 3000) => {
  Toast({
    message,
    duration,
    position,
  })
}
Vue.prototype.$indicator = Indicator

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
})
